package com.flink.timewindow.partition;

import org.apache.flink.api.common.functions.Partitioner;

public class CustomPartitioner implements Partitioner<String> {

    @Override
    public int partition(String key, int numPartitions) {//numPartitions分区数取下游算子的并行度
        return Integer.parseInt(key) % numPartitions;
    }
}